package com.sixbro.shiro.uaa;

import com.sixbro.shiro.uaa.realm.ResourceServerRealm;
import org.apache.shiro.realm.Realm;
import org.springframework.boot.autoconfigure.AutoConfigureBefore;
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
import org.springframework.context.annotation.Bean;

/**
 * <p>
 *
 * </p>
 *
 * @Author: Mr.Lu
 * @Since: 2020/6/19 18:03
 */
@AutoConfigureBefore({ShiroAutoConfiguration.class, ResourceServerFilterAutoConfiguration.class})
@ConditionalOnClass(Realm.class)
public class ResourceServerShiroAutoConfiguration {

    @Bean
    public Realm oauth2ResourceRealm() {
        ResourceServerRealm resourceServerRealm = new ResourceServerRealm();
        resourceServerRealm.setName("oauth2ResourceRealm");
        return resourceServerRealm;
    }
}
